<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("UTF-8");
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>四川盛世鹏辉建设项目管理有限公司</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href=" css/top.css">
<link rel="stylesheet"
	href=" framework/bootstrap-3.0.0/css/bootstrap.css">
<link rel="stylesheet"
	href=" framework/bootstrap-3.0.0/css/bootstrap-theme.css">
<script type="text/javascript" src=" js/jquery.js"></script>
<script type="text/javascript" src=" js/index.js"></script>
<link
	href="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.css"
	rel="stylesheet" type="text/css" />
<script src="<%=basePath%>common/plugins/jQuery/jQuery-2.1.3.min.js"></script>
<script
	src="<%=basePath%>common/plugins/datatables/jquery.dataTables.js"
	type="text/javascript"></script>
<script
	src="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.js"
	type="text/javascript"></script>
<style>
#div1 {
	background: url(" image/cont2.png");
	width: 135px;
	height: 55px;
}

#div1.hover {
	background: url(" image/cont.png");
	width: 140px;
	height: 55px;
}

#div2 {
	background: url(" image/mes.png");
	width: 135px;
	height: 55px;
}

#div2.hover {
	background: url(" image/mes2.png");
	width: 140px;
	height: 55px;
}

a {
	text-decoration: none;
	color: black;
}

div {
	font-family: 微软雅黑;
	font-size: 14px;
}

.tab {
	border: 1px;
	margin-top: 7%;
	height: 500px;
	width: 90%;
	margin-right: 5%;
	margin-left: 5%
}

td {
	border-left: 0px;
	border-right: 0px;
}
</style>
<script>
        window.onload = function ()
        {
            var oDiv1 = document.getElementById("div1");
            var oDiv2 = document.getElementById("div2");
            oDiv1.onmouseover = function ()
            {
                oDiv1.className = "hover"
            };
            oDiv1.onmouseout = function ()
            {
                oDiv1.className = ""
            }
            oDiv2.onmouseover = function ()
            {
                oDiv2.className = "hover"
            };
            oDiv2.onmouseout = function ()
            {
                oDiv2.className = ""
            }
        };
        
        function check() {
        var content = document.getElementById('content').value;
		
		if (content) {
			
		} else {
			alert('不能为空');
			document.getElementById("content").focus; 
			return false;
		//	example.number.focus();
		}
		}
    </script>
</head>
<body>
	<img src="image/log.png"
		style="height: 70px; width: 50px; z-index: 1; position: absolute; left: 10%;top:10px;" />
	<div style="top: 0px;"><jsp:include page="top.jsp"></jsp:include></div>
	<div>
		<img src="image/21.png" width="100%" />
	</div>
	<span style="margin-left: 7%;"><a href="showfactive.do"> 首页</a>
		><a href="front/contactUs.jsp">联系我们</a>
	</span>
	<br>
	<br>
	<div class="col-md-12" style="height: auto; width: auto;">
		<div class="col-md-3">
			<div style="width: 10%; margin-left: 55%;" id="test">
				<a href="front/contactUs.jsp"><div id="div1"></div>
				</a>
			</div>
			<div style="width: 10%; margin-left: 55%;" id="test2">
				<a href="showmessage.do"><div id="div2"></div> </a>
			</div>
		</div>

		<div class="col-md-9">
			<div id="testDiv"
				style="border: 1px solid grey; display: none; margin-right: 20%; height: auto; width: 80%;">
				<div style="margin-left: 5%; margin-right: 10%; margin-top: 5%;">
					<b> 电话：028-83191320 83331320<br> QQ：2127167909<br>
						地址：成都市武侯区都会路55号城南天府大厦1单元2304号<br> </b>
					${requestScope.message.content}

				</div>
			</div>
			<div id="testDiv2"
				style="border: 1px solid grey; display:block; margin-right: 10%; height: auto; width: 80%;margin-bottom: 10%;">
				<form name="example" method="post" action="addmessage.do"
					accept-charset="UTF-8" onsubmit="document.charset='utf-8';return check()">
					<textarea name="content" cols="100" rows="8" id="content"
						style="width: 80%; height: 130px;margin-left:10%;"></textarea>
					<br /> <input type="hidden" name="time" /> <input type="submit"
						value="发表" style="float: right; margin-right: 10%; color: blue;">

				</form>
				<br>
				<table id="example1" class="table table-bordered table-hover tab"
					style="width: 80%;margin-left:10%;">
					<thead>
						<tr>
							<th style="color: blue;">留言列表</th>
						</tr>
					</thead>
					<tbody>
					<c:forEach items="${requestScope.show}" var="mes">
						<tr>
							<td colspan="2"
								style="word-wrap:break-word; word-break:break-all;">
								${mes.content}</td>
						</tr>
						<tr>
							<td colspan="2">${mes.time}</td>
						</tr>
					</c:forEach>
					</tbody>
					</table>
				</div>
			</div>
		</div>
		<div style="bottom: 0px;"><jsp:include page="bottom.jsp"></jsp:include></div>
	</body>
	<script type="text/javascript">
	$("#example1").dataTable({
		 	"bPaginate": true, // 翻页功能
			"bLengthChange": false, // 改变每页显示数据数量
			"bFilter": false, // 过滤功能
			"bSort": false, // 排序功能
			"bInfo": true, // 页脚信息
			"oLanguage" : {
                "sLengthMenu" : "每页显示_MENU_条记录",
                "sZeroRecords" : "抱歉， 没有找到记录",
                "sInfo" : "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty" : "没有数据",
                "sInfoFiltered" : "(从 _MAX_ 条数据中检索)",
                "oPaginate" : {
                    "sFirst" : "首页",
                    "sPrevious" : "前一页",
                    "sNext" : "后一页",
                    "sLast" : "尾页"
                },
                "sZeroRecords" : "没有检索到数据",
                "sProcessing" : "正在加载中..."
            },
			"bAutoWidth": true, // 自动宽度
		});
    document.getElementById("test2").onclick=function(){
        document.getElementById("testDiv2").style.display="block";
        document.getElementById("testDiv").style.display="none";
    }
    document.getElementById("test").onclick=function(){
        document.getElementById("testDiv").style.display="block";
        document.getElementById("testDiv2").style.display="none";
    }
</script>
</html>
